def dec(func):
    func.a = 22
    print("添加装饰器")
    return func
@dec
def connect():
    print("connect")
    return 1

print(connect())
print(connect.a)